/* 教师界面整体框架
修改人：曾俊达
时间：2020/6/22 */
<template>
    <div class="demo">

        <!-- <h1>book增删改查</h1> -->
         <el-container style="height: 100vh; border: 1px solid #eee">
           
            <el-header style="text-align: right; font-size: 12px">
                <el-dropdown @command="handleCommand">
                    <i class="el-icon-switch-button" style="margin-right: 15px"></i>
                    <el-dropdown-menu slot="dropdown">
                        <el-dropdown-item command="a" >注销</el-dropdown-item>
                        
                    </el-dropdown-menu>
                    {{this.nickname}}
                </el-dropdown>
                
            </el-header>
            <el-container>

                <el-aside width="200px" style="background-color: #545c64">
                    <el-menu default-active="2" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose"
                        :router="true" background-color="#545c64" text-color="#fff" active-text-color="#ffd04b">

                        <el-menu-item>
                            <span>教师界面 </span>
                        </el-menu-item>

                        <el-menu-item index="/create_class">
                            <i class="el-icon-user"></i>
                            <span slot="title">创建课程</span>
                        </el-menu-item>

                        <el-menu-item index="/manage_class">
                            <i class="el-icon-more"></i>
                            <span slot="title">管理课程</span>
                        </el-menu-item>

                        <el-menu-item index="/teacher/infor">
                            <i class="el-icon-more"></i>
                            <span slot="title">个人信息</span>
                        </el-menu-item>
                        
                        <el-menu-item index="/teacher/alter">
                            <i class="el-icon-more"></i>
                            <span slot="title">修改密码</span>
                        </el-menu-item>
                    </el-menu>
                </el-aside>

                <el-main>
                    <router-view />
                </el-main>
            </el-container>
        </el-container>
      

    </div>
</template>
<script>
    // import {
    //     page,
    //     updateUseful
    // } from '@/api/modules/book'
    // import Edit from '@/views/teacher/class_edit'
  import {getCookie,removeCookie} from '@/libs/cookie'
  
    export default {
        name: "teacher",
        components: {

        },
        data() {

            return {
               nickname:''
            };
        },
        mounted(){
            let user = JSON.parse(getCookie("user") || '{}');
            this.nickname = user.nickname
        },

        methods: {
           
            handleOpen(key, keyPath) {
                console.log(key, keyPath);
            },
            handleClose(key, keyPath) {
                console.log(key, keyPath);
            },
            //下拉菜单
            handleCommand(command) {

                if (command == "a") {
                    removeCookie("user")
                    this.navigator("/")
                }
            }
        }
    };
</script>

<style scoped>
    .el-header {
        background-color: #B3C0D1;
        color: #333;
        line-height: 60px;
    }

    .el-aside {
        color: #333;
    }
</style>